package smartt.styy.auth;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;

import smartt.styy.auth.filter.HttpServletRequestReplacedFilter;

/**
 * @author shangtengfei
 * 启动方法 ，入口
 */
@SpringBootApplication
@ServletComponentScan
@MapperScan("smartt.styy.auth.mapper")
public class AuthSpringBootApplication 
{
    public static void main( String[] args ){
    	SpringApplication.run(AuthSpringBootApplication.class, args);
    }
    
    @SuppressWarnings({ "rawtypes", "unchecked" })
	@Bean
	public FilterRegistrationBean httpServletRequestReplacedRegistration() {
		FilterRegistrationBean registration = new FilterRegistrationBean();
		registration.setFilter(new HttpServletRequestReplacedFilter());
		registration.addUrlPatterns("/*");
        registration.addInitParameter("paramName", "paramValue");
		registration.setName("httpServletRequestReplacedFilter");
		registration.setOrder(1);
		return registration;
	}
    
}
